﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JBeamLibrary.Exceptions
{
    public class UnknownPropertyException : DriveException
    {
        #region Fields

        #endregion

        #region Properties

        public string ObjectName { get; set; }

        public string Location { get; set; }

        public string PropertyName { get; private set; }

        public override string Message
        {
            get { return ToString(); }
        }

        #endregion

        #region CTORs

        public UnknownPropertyException(string objName, string location, string propName)
        {
            ObjectName = objName;
            Location = location;
            PropertyName = propName;
        }

        #endregion

        #region Methods

        public override string ToString()
        {
            return string.Format("Invalid property name for '{0}' in '{1}': '{2}'", ObjectName, Location, PropertyName);
        }

        #endregion
    }
}
